{% extends "base.html" %}

{% block header %}
    <table>
        <tr>
            <td>
                <h1>Entries for </h1>
            </td>
            <td style="width: 60%">
                <form action="/journals/" method="GET">
                    <select id="goals_id" name="goal" onchange="this.form.submit();">
                        <option value=''>---------</option>
                        {% for goal in goals %}
                            <option
                                    value="{{ goal.pk }}"
                                    {% if filter_goal_id == goal.pk %}
                                    selected=""
                                    {% endif %}>
                                {% if goal.parent %}
                                    -
                                {% endif %}
                                {{ goal.name }}
                            </option>
                        {% endfor %}
                    </select>
                </form>
            </td>
            <td>
                <a href="/journals/edit/?goal" class="btn">Post new entry</a>
            </td>
        </tr>
    </table>
{% endblock %}